<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>料框</title>
</head>
<!--<body>
<section>
    <div>
        <div class="layui-card">
            <div class="adp-content">
                <table id="queryTable"></table>
            </div>
        </div>
    </div>
</section>
</body>
</html>
<script src="../static/adp/import.js"></script>
<script type="text/javascript">
    /*var queryTable = $("#queryTable").adpTable({
        url: '../rs/Container/getInventoryInfo',
        cols: [[
            {field: 'containerType', title: '物料类型', width: 180},
            {field: 'material', title: '图号', width: 200},
            {field: 'count', title: '库存数', width: 100}
        ]]
    });*/

    layui.use('table', function () {
        var table = layui.table;

        //第一个实例
        table.render({
            elem: '#queryTable'
            , height: 312
            , url: '../rs/Container/getInventoryInfo' //数据接口
            , ContentType: 'application / json'
            , method: 'post'
            , page: false //开启分页
            , where: {}
            , request: {}
            , cols: [[ //表头
                {field: 'containerType', title: '物料类型', width: 180},
                {field: 'material', title: '图号', width: 200},
                {field: 'count', title: '库存数', width: 100}
            ]]
        });

    });
</script>-->
<body>
<section>
    <div>
        <div class="layui-card">
            <div class="adp-content">
                <form id="queryForm"></form>
                <table id="queryTable"></table>
            </div>
        </div>
    </div>
</section>
</body>
</html>
<script src="../static/adp/import.js"></script>

<!--<script type="text/html" id="USER_ROLE_TPL">-->
<!--{{# layui.each(d.roles, function(index, item){ }}-->
<!--<span class="layui-badge layui-bg-blue">{{= item.roleName}}</span>-->
<!--{{# }); }}-->
<!--</script>-->

<script type="text/javascript">
    var queryform = $("#queryForm").adpForm({
        elem: [],
        button: [{type: "submit", label: "查询", method: "query", icon: 'query'}],
        methods: {
            query: function query(data) {
                queryTable.reload();
            }
        }
    });


    var queryTable = $("#queryTable").adpTable({
        url: '../rs/Container/getInventoryInfo',
        where: {},
        cols: [[
            {field: 'containerType', title: '物料类型', width: 180},
            {field: 'material', title: '图号', width: 200},
            {field: 'count', title: '库存数', width: 100}
        ]],
    });

    setInterval(function () {
        queryTable.reload();
        console.log("flash")
    }, 60 * 1000)


</script>